/*
 * Copyright 2017 ObjectBox Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.objectbox.index.model;

import io.objectbox.BoxStore;
import io.objectbox.BoxStoreBuilder;
import io.objectbox.ModelBuilder;
import io.objectbox.ModelBuilder.EntityBuilder;
import io.objectbox.model.PropertyFlags;
import io.objectbox.model.PropertyType;


// THIS CODE was originally GENERATED BY ObjectBox.

/**
 * Starting point for working with your ObjectBox. All boxes are set up for your objects here.
 * <p>
 * First steps (Android): get a builder using {@link #builder()}, call {@link BoxStoreBuilder#androidContext(Object)},
 * and {@link BoxStoreBuilder#build()} to get a {@link BoxStore} to work with.
 */
public class MyObjectBox {

    public static BoxStoreBuilder builder() {
        BoxStoreBuilder builder = new BoxStoreBuilder(getModel());
        builder.entity(new EntityLongIndex_());
        return builder;
    }

    private static byte[] getModel() {
        ModelBuilder modelBuilder = new ModelBuilder();
        modelBuilder.lastEntityId(8, 602677774947261949L);
        modelBuilder.lastIndexId(4, 3512264863194799103L);

        EntityBuilder entityBuilder;

        entityBuilder = modelBuilder.entity("EntityLongIndex");
        entityBuilder.id(7, 3183490968395198467L).lastPropertyId(7, 4606523800036319028L);
        entityBuilder.property("_id", PropertyType.Long).id(7, 4606523800036319028L)
            .flags(PropertyFlags.ID | PropertyFlags.ID_SELF_ASSIGNABLE);
        entityBuilder.property("indexedLong", PropertyType.Long).id(1, 4720210528670921467L)
            .flags(PropertyFlags.NOT_NULL | PropertyFlags.INDEXED).indexId(4, 3512264863194799103L);
        entityBuilder.property("float1", PropertyType.Float).id(2, 26653300209568714L)
            .flags(PropertyFlags.NON_PRIMITIVE_TYPE);
        entityBuilder.property("float2", PropertyType.Float).id(3, 6911688523695505281L)
            .flags(PropertyFlags.NON_PRIMITIVE_TYPE);
        entityBuilder.property("float3", PropertyType.Float).id(4, 1000571928939466340L)
            .flags(PropertyFlags.NON_PRIMITIVE_TYPE);
        entityBuilder.property("float4", PropertyType.Float).id(5, 7821283012441809394L)
            .flags(PropertyFlags.NON_PRIMITIVE_TYPE);
        entityBuilder.property("float5", PropertyType.Float).id(6, 2566687059506175032L)
            .flags(PropertyFlags.NON_PRIMITIVE_TYPE);
        entityBuilder.entityDone();

        return modelBuilder.build();
    }

}
